<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('所属行业')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select class="form-control selectpicker" name="row[industry_code]" data-rule="required">
                <option value="">请选择行业</option>
                {volist name="industryList" id="industry"}
                <option value="{$industry.industry_code}">{$industry.industry_name}</option>
                {/volist}
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('所属模块')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select class="form-control" name="row[module_name]" data-rule="required">
                <option value="">请选择模块</option>
                <option value="order">订单</option>
                <option value="product">产品</option>
                <option value="process">工序</option>
                <option value="resource">资源</option>
                <option value="equipment">设备</option>
                <option value="employee">员工</option>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('字段名称')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" name="row[field_name]" placeholder="如: fabric_type" data-rule="required;regex(/^[a-zA-Z][a-zA-Z0-9_]*$/);remote(scanwork/custom_field/check_unique?field=field_name)">
            <span class="help-block">英文字段名，只能包含字母、数字、下划线</span>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('字段标签')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" name="row[field_label]" placeholder="如: 面料类型" data-rule="required">
            <span class="help-block">显示给用户看的中文名称</span>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('字段类型')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select class="form-control" name="row[field_type]" data-rule="required" id="field_type">
                <option value="text">文本</option>
                <option value="number">数字</option>
                <option value="date">日期</option>
                <option value="datetime">日期时间</option>
                <option value="select">下拉选择</option>
                <option value="textarea">多行文本</option>
                <option value="checkbox">复选框</option>
                <option value="radio">单选框</option>
            </select>
        </div>
    </div>
    <div class="form-group" id="options_group" style="display:none;">
        <label class="control-label col-xs-12 col-sm-2">{:__('选项配置')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea class="form-control" name="row[field_options]" rows="3" placeholder='["选项1","选项2","选项3"]'></textarea>
            <span class="help-block">JSON格式，如: ["真皮","仿皮","布艺","绒布"]</span>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('默认值')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" name="row[default_value]">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('是否必填')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="radio" name="row[is_required]" value="1"> 是
            <input type="radio" name="row[is_required]" value="0" checked> 否
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('是否可搜索')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="radio" name="row[is_searchable]" value="1" checked> 是
            <input type="radio" name="row[is_searchable]" value="0"> 否
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('是否显示')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="radio" name="row[is_visible]" value="1" checked> 是
            <input type="radio" name="row[is_visible]" value="0"> 否
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('排序')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="number" class="form-control" name="row[sort]" value="100">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('状态')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select class="form-control" name="row[status]">
                <option value="normal" selected>正常</option>
                <option value="hidden">隐藏</option>
            </select>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>


